/** ###################################################################
**     Filename  : sensortest07.C
**     Project   : sensortest07
**     Processor : 56F8013VFAE
**     Version   : Driver 01.14
**     Compiler  : Metrowerks DSP C Compiler
**     Date/Time : 2012/3/21, 13:23
**     Abstract  :
**         Main module.
**         This module contains user's application code.
**     Settings  :
**     Contents  :
**         No public methods
**
** ###################################################################*/
/* MODULE sensortest07 */


/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h"
#include "AD1.h"
#include "TI1.h"
#include "Term1.h"
#include "Inhr1.h"
/* Including shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
#include "sensor.h"
//------------------------------------------------------------------------

#define LOOP_TIME	1000
//------------------------------------------------------------------------

unsigned int nLoop; 
float debugWord[2];
//-------------------------------------------------------------------------

void main(void)
{
  /* Write your local variable definition here */

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  calibrateSensor();
  /* Write your code here */      
  nLoop = 0;
  
  for(;;) { 
  	  /*nLoop ++;
      if(nLoop >= LOOP_TIME) 	
        nLoop = 0;
      else continue;*/
      
     
      
      if(debugFlag == 1)
      {
       debugWord[0] = g_fGravityAngle * 5.0;
      debugWord[1] = g_fGyroscopeAngleIntegral * 5.0;
      Term1_SendNum(debugWord[0]);
      //Term1_SendFloatNum(debugWord[0]);
      Term1_SendChar(' ');
      Term1_SendNum(debugWord[1]);
      //Term1_SendFloatNum(debugWord[1]);
      Term1_CRLF();
      debugFlag = 0;
      }
      
      
      

  }
}

/* END sensortest07 */
/*
** ###################################################################
**
**     This file was created by Processor Expert 3.00 [04.35]
**     for the Freescale 56800 series of microcontrollers.
**
** ###################################################################
*/
